<html>
<head>
<title>Cookie with ALL bytes 0x01-0xff (JavaScript)</title>
<script type="text/javascript" src="/shared/scripts/testcase.js"></script>
<script type="text/javascript">
if (window.addEventListener) {
	window.addEventListener('load', f, false);
} else if (window.attachEvent) {
	window.attachEvent('onload', f);
} else {
	window.onload = f;
}

function f() {
	var injbytes = '';
	for (var x = 0x01; x < 0xff; x++) {
		if (x == 0x3b) {
			continue; // 0x3b = ;
		}
		if (x < 0x10) {
			injbytes += '%0' + x.toString(16);
		} else {
			injbytes += '%' + x.toString(16);
		}
	}
	injbytes = unescape(injbytes);
	var cookie_val = 'cookie=NOMNOMNOMOM'+injbytes+'x: 1;';
	var tc = new TestCase();
	tc.input = cookie_val;
	tc.description = 'Cookie with ALL bytes 0x01-0xff (JavaScript)';
	document.cookie = cookie_val;
	tc.sendRequest('GET', 'showRequest.rpy', null, save_test);
}

function save_test(xhr, tc) {
	tc.output = xhr.responseText;
	tc.clearCookies();
	tc.saveTest(null);
}
</script>
</head>
<body></body>
</html>